<!DOCTYPE html>
<html>
	<head>
		<script src="https://d3js.org/d3.v4.min.js"></script>
	</head>
	<body>
		<p></p>
		<p></p>
		<p></p>
	</body>
	<script type="text/javascript">
		var data = [1,2,3];
		d3.select("body")
			.selectAll("p")
			.data(data)
			.text(function(d,i){
				console.log(d)
				console.log(i)
				console.log(this)
				return "This index is "+i+",and the data is "+d;
			})
	</script>
</html>
